import request from '@/utils/request';

// 会员列表
export function getMemberList(data: any) {
    return request({
        url: '/scrm-api/console/member/list',
        method: 'post',
        data
    });
}

// 会员列表-导出
export function getMemberListExport(data: any) {
    return request({
        url: '/scrm-api/console/member/list/export',
        method: 'post',
        data
    });
}

// 积分列表
export function getPointsRecord(data: any) {
    return request({
        url: '/scrm-api/console/member/points/record',
        method: 'post',
        data
    });
}

// 成长值列表
export function getGrowthList(data: any) {
    return request({
        url: '/scrm-api/console/member/growth/list',
        method: 'post',
        data
    });
}

// 会员等级变更记录
export function getMemberLevelRecord(data?: any) {
    return request({
        url: '/scrm-api/console/member/level/member-change-record',
        method: 'post',
        data
    });
}

// 会员来源列表
export function getMemberChannelList(data?: any) {
    return request({
        url: '/scrm-api/console/member/channel/list',
        method: 'post',
        data
    });
}

/* 
  店铺列表 /scrm-api/console/retail/shop/store-list   
*/
export const storeList = (params: any) => {
    return request({
        url: '/scrm-api/console/retail/shop/store-list',
        params
    });
};

//会员详情页-交易信息
export const memberOrder = (data: any) => {
    return request({
        url: '/scrm-api/console/member/orderInfo',
        method: 'post',
        data
    });
};

//会员详情-店铺信息
export const memberShop = (data: any) => {
    return request({
        url: '/scrm-api/console/member/shopStat',
        method: 'post',
        data
    });
};

//会员详情-会员信息
export const memberInfo = (data: any) => {
    return request({
        url: '/scrm-api/console/member/info',
        method: 'post',
        data
    });
};

//会员信息-统计信息
export const memberStat = (data: any) => {
    return request({
        url: '/scrm-api/console/member/orderStat',
        method: 'post',
        data
    });
};

//会员详情-获取会员手机号明文
export const decryMobile = (data: any) => {
    return request({
        url: '/scrm-api/console/member/decrypt-mobile',
        method: 'post',
        data
    });
};

/**
 * @description 会员列表-冲突提醒设置
 * @param {switch} 1-开 2-关
 * @param {work_user_ids} 员工IDS
 * @returns
 */
export const memberConfilictRemin = (data: any) => {
    return request({
        url: '/scrm-api/console/member/conflict/remin',
        method: 'post',
        data
    });
};

/**
 * @description 会员列表-设置会员通积分计算规则
 * @param {shop_id} 店铺id
 * @param {member_rule_follow} 会员通应用 1-使用官方会员通 2-使用客易达会员通
 * @returns
 */
export const memberSwitchChannel = (data: any) => {
    return request({
        url: '/scrm-api/console/retail/shop/set-hyt-points-rule',
        method: 'post',
        data
    });
};

/**
 * @description 会员列表-解决冲突
 * @param {type} //1 换绑 2 整体换绑
 * @param {member_shop_id} 冲突ID
 * @returns
 */
export const memberClashHandle = (data: any) => {
    return request({
        url: '/scrm-api/console/member/conflict/handle',
        method: 'post',
        data
    });
};
/**
 * @description 会员列表-冲突详情
 * @param {member_no} 会员ID
 * @param {conflict_scene} 解决冲突时的场景
 * @returns
 */
export const memberConflictInfo = (data: any) => {
    return request({
        url: '/scrm-api/console/member/conflict/info',
        method: 'post',
        data
    });
};

/**
 * @description: 获取冲突提醒详情
 * @return {*}
 */
export const reminDetail = () => {
    return request({
        url: '/scrm-api/console/member/conflict/remin/detail',
        method: 'post'
    });
};

/**
 * @description: 设置会员通积分计算规则
 * @param {any} data
 * @return {*}
 */
export const setHytPointsRule = (data: any) => {
    return request({
        url: '/scrm-api/console/retail/shop/set-hyt-points-rule',
        method: 'post'
    });
};

/**
 * @description: 手动调整成长值
 * @param {any} data
 * @return {*}
 */
export const experienceCustom = (data: any) => {
    return request({
        url: '/scrm-api/console/member/experience/custom',
        method: 'post',
        data
    });
};

/**
 * @description: 手动调整积分
 * @param {any} data
 * @return {*}
 */
export const pointsCustom = (data: any) => {
    return request({
        url: '/scrm-api/console/member/points/custom',
        method: 'post',
        data
    });
};

/**
 * @description: 互动积分记录
 * @param {any} data
 * @return {*}interPoints
 */
export const interactPoints = (data: any) => {
    return request({
        url: '/scrm-api/console/customer/interaction-points-list',
        method: 'post',
        data
    });
};

/**
 * @description: 搜索客户参与的活动
 * @param {any} data
 * @return {*}interPoints
 */
export const searchActivity = (data: any) => {
    return request({
        url: '/scrm-api/console/market/punch-card/data/activity-list',
        method: 'post',
        data
    });
};

/**
 * @description: 绑定店铺订单
 * @param {any} data
 * @return {*}
 */
export const bindShopOrder = (data: any) => {
    return request({
        url: '/scrm-api/console/member/bind-order',
        method: 'post',
        data
    });
};
